From 794eb21733792a44f839162b72723a928f72f33f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Sun, 25 Jan 2009 09:12:41 +0000 Subject: [PATCH] * (bug 17150) escapeLike now escapes literal \ properly --- RELEASE-NOTES | 1 + includes/db/Database.php | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 24c52b430a..6153ba1b2f 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -81,6 +81,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 10569) redirects to Special:Mypage and Special:Mytalk are no longer allowed by default. Change $wgInvalidRedirectTargets to re-enable. * (bug 3043) Feed links of given page are now preceded by standard feed icon +* (bug 17150) escapeLike now escapes literal \ properly == API changes in 1.15 == * (bug 16858) Revamped list=deletedrevs to make listing deleted contributions diff --git a/includes/db/Database.php b/includes/db/Database.php index b86f35d21d..586baee4bc 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -1397,7 +1397,7 @@ class Database { } else { $list .= $field." IN (".$this->makeList($value).") "; } - } elseif( is_null($value) ) { + } elseif( $value === null ) { if ( $mode == LIST_AND || $mode == LIST_OR ) { $list .= "$field IS "; } elseif ( $mode == LIST_SET ) { @@ -1605,7 +1605,7 @@ class Database { * Otherwise returns as-is */ function addQuotes( $s ) { - if ( is_null( $s ) ) { + if ( $s === null ) { return 'NULL'; } else { # This will also quote numeric values. This should be harmless, @@ -1621,7 +1621,7 @@ class Database { */ function escapeLike( $s ) { $s=$this->strencode( $s ); - $s=str_replace(array('%','_'),array('\%','\_'),$s); + $s=str_replace(array('%','_','\\'),array('\%','\_','\\\\'),$s); return $s; } -- 2.20.1